﻿@model IEnumerable<DeyuMvc.Models.Users>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.TeacherName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PhotoUrl)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PhotoThumbUrl)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Xueke)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Nianjizu)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Banji)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.UserName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Password)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.TeacherName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PhotoUrl)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PhotoThumbUrl)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Xueke)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Nianjizu)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Banji)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Password)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.TeacherCode }) |
            @Html.ActionLink("Details", "Details", new { id=item.TeacherCode }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.TeacherCode })
        </td>
    </tr>
}

    @foreach (var obj in Model)
    {
    <a href=@Url.Action("Details", "User", new {id = @obj.TeacherCode})>
        <div class="col-sm-6 col-md-3" style="margin-bottom: 10px">
            <div class="thumbnail">
                <img src="@obj.PhotoThumbUrl" alt="@obj.TeacherName"/>
                <div class="caption">
                    <h3>@obj.TeacherName</h3>
                    <p>
                        <h4>年级组：@obj.Nianjizu</h4>
                    </p>
                    <p>
                        <h4>工号：@obj.TeacherCode</h4>
                    </p>
                    @*<p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>*@
                </div>
            </div>
        </div>
    </a>
    }

</table>
